cmake_minimum_required(VERSION 3.10)

set(BIN_DIR "${PROJECT_SOURCE_DIR}/bin")
set(LIB_DIR "${PROJECT_SOURCE_DIR}/lib")
#set(AB_UTILS_LIB_DIR "${PROJECT_SOURCE_DIR}/ab_utils/lib")

set(CMAKE_CXX_FLAGS "-O3")

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BIN_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIB_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIB_DIR})

#include path
include_directories(${PROJECT_SOURCE_DIR})
include_directories(${PROJECT_SOURCE_DIR}/inc)
#include_directories(${PROJECT_SOURCE_DIR}/ab_utils/inc)
#include_directories(${PROJECT_SOURCE_DIR}/ab_utils/third_party/libssh/include)
#include_directories(${PROJECT_SOURCE_DIR}/ab_utils/third_party/yamlcpp/include)
#include_directories(${PROJECT_SOURCE_DIR}/ab_utils/third_party/openssl/include)


#only header libs
include_directories(${PROJECT_SOURCE_DIR}/third_party/cpp-httplib/include)
include_directories(${PROJECT_SOURCE_DIR}/third_party/json)

#non standard libs path
link_directories(.)
link_directories(${LIB_DIR})
#link_directories(${PROJECT_SOURCE_DIR}/ab_utils/lib)
#link_directories(${PROJECT_SOURCE_DIR}/ab_utils/third_party/libssh/lib)
#link_directories(${PROJECT_SOURCE_DIR}/ab_utils/third_party/yamlcpp/lib)
#link_directories(${PROJECT_SOURCE_DIR}/ab_utils/third_party/openssl/lib64)

#src files


set(AGENT_SRC_LIST
        coverageParser.cpp
        http_server.cpp
        agent.cpp
        base64.cpp
        ab_logger.cpp
        ab_process.cpp
        ab_shm.cpp
)



#targets
add_executable(rtos-agent ${AGENT_SRC_LIST})
TARGET_LINK_LIBRARIES(rtos-agent libpthread.so)
#TARGET_LINK_LIBRARIES(agent libab_utils.a libssl.a libcrypto.a)
